Taper leithy#403
Conversation
Moves a global computation outside of a do loop so that it doesn't do the global computation over and over.
|
The MOM6 code style guide at https://github.com/mom-ocean/MOM6/wiki/Code-style-guide#array-syntax disallows this type of usage of array syntax. It seems like fix the identified problem, and adhere to the style guide, by keeping the original multiplication of |
|
Thanks! I will make that change. |
|
That will also mean I don't need the "where" statements in the leithy taper function. |
|
So it looks like the original code was multiplying the entire array |
|
Thanks again! I'm rushing this as I approach the weekend. In fact I'm writing this from the car. I agree about the correctness. This does not affect the 090 series of G cases which I used to tune the taper, but it does affect coupled run 236.002. Maybe that's a partial explanation for why the MOC is different in 236.002 as compared to the G case runs. |
This fixes a bonehead mistake in the depth-based tapering of Leith+E (aka Leithy) backscatter. The code computes and applies the taper over the entire 2D tile simultaneously; the bonehead mistake was to put that computation inside a do loop over the elements of the tile, so that the computational cost is squared. This PR simply moves the computation and application of the taper back outside the do loop, where it should be.